aboutsummaryrefslogtreecommitdiff
path: root/src/app/info/[id]/page.jsx
diff options
context:
space:
mode:
authorreal-zephex <[email protected]>2024-03-18 14:03:32 +0530
committerreal-zephex <[email protected]>2024-03-18 14:03:32 +0530
commitb1f4f412059760d85f531c3d6e2ee626c9002d28 (patch)
treedbbb23233b9388170d52fb67de6c5f48a16c30d7 /src/app/info/[id]/page.jsx
parentfixed a minor bug (diff)
downloaddramalama-b1f4f412059760d85f531c3d6e2ee626c9002d28.tar.xz
dramalama-b1f4f412059760d85f531c3d6e2ee626c9002d28.zip
fixes: change the file extension to .jsx and fixed the video player sizes for tablets
Diffstat (limited to 'src/app/info/[id]/page.jsx')
-rw-r--r--src/app/info/[id]/page.jsx49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/app/info/[id]/page.jsx b/src/app/info/[id]/page.jsx
new file mode 100644
index 0000000..5048612
--- /dev/null
+++ b/src/app/info/[id]/page.jsx
@@ -0,0 +1,49 @@
+import "../info.css";
+import Image from "next/image";
+import Link from "next/link";
+
+export default async function AnimeInfo({ params }) {
+ let animeID = params.id;
+
+ const info = await getAnimeInfo(animeID);
+
+ return (
+ <div className="dramaInfoContainer">
+ <div className="dramaInfo">
+ {info && (
+ <div>
+ <div className="titleContainer">
+ <p>{info.title}</p>
+ <Image
+ src={info.image}
+ width={140}
+ height={190}
+ alt="Drama"
+ />
+ </div>
+ <p className="dramaDescription">{info.description}</p>
+ </div>
+ )}
+
+ <div className="buttonContainer">
+ {info &&
+ info.episodes.map((item, index) => (
+ <Link href={`/video/${item.id}`} key={index}>
+ <button className="dramaButton">
+ {item.number}
+ </button>
+ </Link>
+ ))}
+ </div>
+ </div>
+ </div>
+ );
+}
+
+async function getAnimeInfo(anime_id) {
+ const res = await fetch(
+ "https://anime-sensei-api.vercel.app/anime/gogoanime/info/" + anime_id
+ );
+ const data = res.json();
+ return data;
+}